package com.ala4.oxcafe.entity;

import com.ala4.oxcafe.annotation.AttachmentsUrl;
import com.ala4.oxcafe.core.entity.BaseEntity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 服务单明细表实体
 *
 * @author PING
 * @version 1.0.0
 * @date 2025/8/15 11:59
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("service_order_detail")
@Schema(description = "服务单明细表实体")
public class ServiceOrderDetail extends BaseEntity {

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @Schema(description = "明细ID")
    private Long id;

    @TableField("service_id")
    @Schema(description = "关联服务单ID")
    private Long serviceId;

    @Schema(description = "关联的质保单ID")
    private Long warrantyId;

    @TableField("product_id")
    @Schema(description = "产品ID")
    @NotNull(message = "产品ID不能为空", groups = {ServiceOrder.Create.class, ServiceOrder.Update.class})
    private Long productId;

    @TableField("product_name")
    @Schema(description = "产品名称")
    private String productName;

    @TableField("product_series")
    @Schema(description = "产品系列")
    private String productSeries;

    @TableField("film_part")
    @Schema(description = "贴膜部位")
    private String filmPart;

    @TableField("film_code")
    @Schema(description = "车衣卷码")
    private String filmCode;

    @TableField("construction_image")
    @Schema(description = "施工图片路径")
    @AttachmentsUrl
    private String constructionImage;
}
